{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [],
   "source": [
    "import scipy.stats as st\n",
    "import matplotlib.pyplot as plt\n",
    "po = st.poisson(1)\n",
    "pmf_list = [po.pmf(i) for i in range(10)] # pmf: probability mass function，概率质量函数"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAX0AAAD8CAYAAACb4nSYAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvhp/UCwAAEUBJREFUeJzt3X+sX3ddx/Hny9YOGQEHu//YH7RAUYroppeCEmYCg5Vg1v0xQmcww5A0mFWm00gRspkSEn4YxMQia6TGIFjGRsyNKdaFDRKCG737IbOdze4KrtdiuNDJVHDjjrd/3IP57u5299x7v7vfbZ/nI7np+XzO53Pu+2zt63vu+XVTVUiS2vAToy5AkrR6DH1JaoihL0kNMfQlqSGGviQ1xNCXpIYY+pLUEENfkhpi6EtSQ9aOuoD5zj///Nq8efOoy5Ckp5U77rjjO1U1tti4p1zob968mcnJyVGXIUlPK0n+rc84T+9IUkMMfUlqiKEvSQ0x9CWpIYa+JDXE0Jekhhj6ktQQQ1+SGmLoS1JDnnJP5K7Y+PjK5q/0aeBRf39JegIe6UtSQwx9SWqIoS9JDTH0Jakhhr4kNaRX6CfZkeREkqkkexdY/84k9yS5O8lXkmzr+jcn+UHXf3eSTwx7ByRJ/S16y2aSNcB+4A3ANHA0yURVHR8Y9pmq+kQ3/lLgo8CObt39VXXBcMuWJC1HnyP97cBUVZ2sqkeAQ8DOwQFV9dBA81yghleiJGlY+oT+euDUQHu663uMJFcluR/4MPCugVVbktyV5MtJXruiaiVJK9In9LNA3+OO5Ktqf1W9GHg38L6u+1vApqq6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eAA30KXqkkk1W1wp/Bn77cf/ff/W93/6Hf6Z2jwNYkW5KsY+7C7MS8MRPAld3y5cAtVVVd/67u7p4twFbga8MpXZK0VIse6VfVbJI9wBFgDXCwqo4l2QdMVtUE8EngU92F2jPMfTDQjbuBuYu+s8BVVfXok7QvkqRFZO6AvB1Jdnenk5rk/rv/7n+7+w8Nhr4ktczXMEhSQ5oJ/cVeJfFMlmRjkluT3JvkWJKrR13TKCRZk+SuJH8/6lpWW5KfTnJjkn/t/h78yqhrWk1Jfq/7u/8vSf42ybNGXdOoNBH6PV8l8Uw2C/x+Vb0MeDVwVWP7/2NXA/eOuogR+TPgH6rq54BfpKH/DknWA+8Cxqvq55m7IWXXaKsanSZCn4FXSVTVI8CPXyXRhKr6VlXd2S3/F3P/4Jt6MjrJBuDNwF+OupbVluS5wEXM3WVHVT1SVf852qpW3Vrgp7rniJ7NAs8LtaKV0Pd1EJ3uDagXArePtpJV9zHgD4EfjbqQEXgRMAP8VXd66y+TnDvqolZLVf078CfAA8C3gO9V1T+OtqrRaSX0e70O4pkuyXOAm4DfraqHRl3Pakny68C3q+qOUdcyImuBXwL+oqouBP4HaOa6VpLzmPvJfgvwM8C5Sd422qpGp5XQ7/U6iGeyJD/JXOB/uqo+P+p6VtlrgEuTfJO5U3uvS/I3oy1pVU0D01X145/ubmTuQ6AVFwPfqKqZqvoh8HngV0dc08i0Evp9XiXxjNW95vqTwL1V9dFR17Paquo9VbWhqjYz9//+lqpq5kivqv4DOJXkZ7uu1/PYV6M/0z0AvDrJs7t/C6+noQvZ8/V54drT3tleJTHislbTa4DfBO5JcnfX90dVdXiENWl1/Q7w6e6g5yTwWyOuZ9VU1e1JbgTuZO5OtrtYpRc8PhX5RK4kNaSV0zuSJAx9SWqKoS9JDTH0Jakhhr4kNcTQl6SGGPqS1BBDX5Ia8n/sTuaYEm2v2wAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "rects1 = plt.bar(x=range(0,10,1), height=pmf_list, width=0.5, alpha=0.8, color='red', linewidth=2)\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "2"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "import numpy as np\n",
    "import scipy.stats as st\n",
    "money = [5,4,8,9,10,3]\n",
    "L = 5\n",
    "labelnum = round(max(money) / L)# 风险暴露总级数\n",
    "labelnum"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Help on built-in function round in module builtins:\n",
      "\n",
      "round(...)\n",
      "    round(number[, ndigits]) -> number\n",
      "    \n",
      "    Round a number to a given precision in decimal digits (default 0 digits).\n",
      "    This returns an int when called with one argument, otherwise the\n",
      "    same type as the number. ndigits may be negative.\n",
      "\n"
     ]
    }
   ],
   "source": [
    "help(round)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{1: [5, 4, 3], 2: [8, 9, 10]}"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "label = {}# 频段级及对应的贷款贷款金额\n",
    "for i in money:\n",
    "    for j in range(1, labelnum+1):\n",
    "        if round(i / L) == j:\n",
    "            if j not in label.keys():\n",
    "                label[j] = [i]\n",
    "            else:\n",
    "                label[j].append(i)\n",
    "label"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[0., 0.],\n",
       "       [0., 0.],\n",
       "       [0., 0.],\n",
       "       [0., 0.]])"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "arr = np.zeros((len(label[1])+1,labelnum))# 各个频段级对应的违约数的概率分布\n",
    "arr"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<scipy.stats._distn_infrastructure.rv_frozen at 0x1698a830cf8>"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# λ=1\n",
    "rv = st.poisson(1)\n",
    "rv"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[0.3679, 0.3679],\n",
       "       [0.3679, 0.3679],\n",
       "       [0.1839, 0.1839],\n",
       "       [0.0613, 0.0613]])"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "for i in range(arr.shape[0]):\n",
    "    for j in range(arr.shape[1]):\n",
    "        arr[i][j] = round(rv.pmf(i), 4)\n",
    "arr"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(4, 2)"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "arr.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "(4, 4)\n",
      "(4, 4)\n"
     ]
    }
   ],
   "source": [
    "pro = np.zeros((arr.shape[0], arr.shape[0]))# 联合违约概率\n",
    "loss = np.zeros((arr.shape[0], arr.shape[0]))# 违约总损失\n",
    "print(pro.shape)\n",
    "print(loss.shape)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[0.1354, 0.1354, 0.0677, 0.0226],\n",
       "       [0.1354, 0.1354, 0.0677, 0.0226],\n",
       "       [0.0677, 0.0677, 0.0338, 0.0113],\n",
       "       [0.0226, 0.0226, 0.0113, 0.0038]])"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "for i in range(pro.shape[0]):\n",
    "    for j in range(pro.shape[1]):\n",
    "        loss[i, j] = i * L + j * 2* L\n",
    "        pro[i, j] = round(arr[i, 0] * arr[j, 1], 4)\n",
    "pro"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[ 0., 10., 20., 30.],\n",
       "       [ 5., 15., 25., 35.],\n",
       "       [10., 20., 30., 40.],\n",
       "       [15., 25., 35., 45.]])"
      ]
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "loss"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{0.0: 0.1354,\n",
       " 5.0: 0.1354,\n",
       " 10.0: 0.2031,\n",
       " 15.0: 0.158,\n",
       " 20.0: 0.1354,\n",
       " 25.0: 0.0903,\n",
       " 30.0: 0.0564,\n",
       " 35.0: 0.0339,\n",
       " 40.0: 0.0113,\n",
       " 45.0: 0.0038}"
      ]
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "arr2 = {}# 整理之后的贷款违约损失的概率分布\n",
    "for i in range(pro.shape[0]):\n",
    "    for j in range(pro.shape[1]):\n",
    "        if loss[i, j] not in arr2.keys():\n",
    "            # print(\"loss[i, j]\", loss[i, j])\n",
    "            arr2[loss[i, j]] = pro[i, j]\n",
    "        else:\n",
    "            arr2[loss[i, j]] = round((arr2[loss[i, j]] + pro[i, j]), 4)\n",
    "arr2 = sorted(arr2.items(), key=lambda x: x[0])\n",
    "arr2 = dict(arr2)\n",
    "# print(\"arr2\",arr2)\n",
    "arr2"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 32,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{0.0: 0.1354,\n",
       " 5.0: 0.2708,\n",
       " 10.0: 0.4739,\n",
       " 15.0: 0.6319,\n",
       " 20.0: 0.7673,\n",
       " 25.0: 0.8576,\n",
       " 30.0: 0.914,\n",
       " 35.0: 0.9479000000000001,\n",
       " 40.0: 0.9592,\n",
       " 45.0: 0.9630000000000001}"
      ]
     },
     "execution_count": 32,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "accu_pro = {}# 累积概率密度\n",
    "for j in range(len(arr2)):\n",
    "    sum = 0\n",
    "    for i in range(j+1):\n",
    "        sum = sum + list(arr2.values())[i]\n",
    "    accu_pro[list(arr2.keys())[j]] = sum \n",
    "accu_pro = sorted(accu_pro.items(), key=lambda x: x[0])\n",
    "accu_pro = dict(accu_pro)\n",
    "accu_pro"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 45,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYcAAAEcCAYAAAAsv3j+AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvhp/UCwAAIABJREFUeJzt3Xl4FFXW+PHvISAIYQkIRtEhIoiiAkpUoiaEGQXXERVxFB0UFMSR+Y3I4BYXFBdceN1we0EcmBmWcUFwAxxoAQfFgICMG74sCkpACUsQWZLz++PeDp1ekgbSHQLn8zz1pKv6Vt1b3Z06VffeuiWqijHGGBOqRlUXwBhjzP7HgoMxxpgIFhyMMcZEsOBgjDEmggUHY4wxESw4GGOMiWDB4QAjIoeJSKaI7NV3KyKHxpkuRURkb/IoZ5uVsr3KLpdJrr35/kTkaBHJE5EjElGmg5EFh2pKRFqKyHQROTXsrbuAvwF19mKbDwIr4kzeA/hSRA7f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HCZHSJYveIk4Fy0kwB2vrXd+CGhIi5zY4dO6oxxsQycOBAfeedd1RVdfz48frKK69EpGnfvr1u375dVVVvueUWnTx5so4cOVLbtm2rp512mvbp00d37typl1xyiX799deqqvrEE0/oU089VWY7t912m44fP75S8t+xY4e2adNGb731Vp08eXKZ9B9++KFmZ2frpk2b4tp+NIR0Ky5vSkq1kqpu1pCbZ2Kox+4blTbg+pOXISL9RCRfRPLXr4/aa9MYsx/p27cvWVlZDBs2LOr7K1as4MILLyQ7O5vbbrutzHsFBQWccsopALzwwgvk5uaSm5tLhw4d6N+/f7nrAmzdupXmzZsD0LhxYwoKIocS69GjB0OHDmXq1Km8//77/O53v+O0007jgw8+YP78+ezcuZN3332Xyy+/nEcffZQZM2YwevRoLrnkktJtLF++nJkzZ3L55ZdXSv5jx46lbdu2DBkyhPnz5/Pss88C7kR+4sSJpKWlUatWrbi2vy/2pwbpInYP3hZ8Lm4ZqvqyqmaqambTphVfFRljqs4bb7xBcXEx8+bNY/ny5Sxbtiwize23384999zDnDlzWL16NYFAoPS9wYMHs22bGwVkwIABBAIBAoEA2dnZ3HjjjeWuC5Camlq6flFRESUlkcN05eXlcf755zNq1Ch69+5Namoq7dq144gjjgAgMzOTZcuWce2113LLLbcwceJEzjzzTIJV2tu3b+e6667j5Zdfplatsjfo723+n332Gf369SM9PZ1rrrmGWbNmAW7sspEjR9KuXTumTJkS1/b3xf4UHBbg7ugFNwTByqorijFmXwUCAXr27AlA165dmTt3bkSab775hlNPdc2QzZo1Y9MmV8Ewc+ZM6tWrR3p6epn0a9asoaCggMzMzJjrBnXs2LE0z8WLFxOrjbJDhw589913DBo0CIBrr72WxYsXU1xczOTJk2nfvn1puqVLl/LAAw+Urnv99ddz3XXXkZmZGbHdvc2/VatWLF++HID8/HxatGjB8OHDGTt2LAAbN26kUaNGcW9/r8VT91RZE7sflfhbIp8b3AJ36/vTuLt+Yz7WUq3NwZj9Xp8+fXTRokWqqjpt2jR95JFHItI8+OCDetddd+mUKV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Bam+7kkbzzTe7H5+dm5vLsGHDWLVqFRdccAFz5szhiy++4IwzzkjYvpjks66sxhzAEt2V9IcffmDu3Ll069Ytop0ipqquVjrI87eurMaYhHclPfLII62r6gHK2hyMMcZEsOBgjDEmggUHY4wxEazNwZgEqWhco8LCQnr16sW6devo2LEjL730Ert27aJly5a0bNkScENUfPvttzz99NMA/PrrrzRs2LD0LuXhw4dTt25dBg4cGH/BqrpB1lQLFhyMSYB4xjUaN24cvXr1olevXlx99dXk5+dTo0YNrrrqKoYPH16a7uSTT+bSSy8FXLfTY489FoBvv/2WqVOn8uGHHyZvx8xBw6qVjEmAeB6R2aRJE5YuXcrGjRv5/vvvOfroo/n44495++23Of300+nbty+7du0qTb9t2zamT5/OZZddBkD//v057rjjGD9+PMXFxcnZMXPQsOBgTALEM+7Q2WefzapVq3jmmWc44YQTaNy4MaeddhoffPAB8+fPZ+fOnbz77rul6ceNG1f6sJx///vf/PLLLzzwwAMUFRUxZMiQ5OyYOWhYtZIxCRDPuEZDhw7lxRdfpEGDBowYMYIxY8bQu3dvateuDUBmZibLli0rTT9+/HimTp0KwGeffUbv3r056qij6N27N2eddVYS9socTOzKwZgEiGfcocLCQj7//HOKi4v55JNPEBGuvfZaFi9eTHFxMZMnT6Z9+/YArFy5koYNG5YObteqVSuWL18OQH5+Pi1atEjOjpmDhl05GJMA8YxrdOedd3L99dezatUqsrKyuOqqq8jKyuLqq69GVfn973/POeecA8D06dPLPCLz4osv5p133iEnJ4ctW7YwduzYpO+jObDZ2ErGJMh++4jMqu7KavlXaf42tpIxVcwekWmqM2tzMMYYE8GCgzHGmAgWHIwxxkSwNgdjkq2qG0SNiYNdORhjjIlgwcEYY0wECw7GGGMiWHAwxhgTwYKDMcaYCBYcjDHGRLDgYMw+2LBhAzNmzOCnn36q6qIYU6ksOJgDWt++fcnKyiozGmqoF154gdzcXHJzc+nQoQP9+/cvfe/mm28ufX5CtHSFhYVcdNFFzJ8/ny5durB+/fqk7JMxyZCU4CAio0VknohE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M6Sl6tqCe5+hfeBwbgurf+NtpKqnqCqR6lqhqpm4A6S/xuc9+8dHhoYRKQrkIMLPIhIExG53efXHze+/2fAXBH5H9+jCRGp77vAfol7XvCVwe363kq9fXlXicjLvkoMEUkRd0f3fbhqq1NDypKL6wH1gIjUkLLPHBbgGPF3bOOq1AT3SMn7cFcQJbjg8keMqUgiHxZhk02VPeEOlv8HHBayrAaujn0b7t4AcI2zf8NV4zTBPWpxDe4pWsFprZ9Cl32Pqx460W9nFDAZV4V0os/jA+D0sHIdjXuIzVm+PB/iegldWs6+1AMGAU+HLLsb1wNriy/HRnZXWW320xbc3diLQ9Y7AnefRXB+Fy4QLAstK3AK8BZwSFV/lzbt35PdBGeqnWDXz7BlTXBn58+HLHsSd8PXvErMu4mq/hxHusa4Lq9xD5dR2Xzj+aGqWlRVZTDVlwUHY4wxEazNwRhjTAQLDsYYYyJYcDDGGBPBgoMxxpgIFhyMMcZEsOBgjDEmwv8HNAEydF44DsgAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "plt.rcParams['font.sans-serif'] = [\"SimHei\"]\n",
    "plt.rcParams[\"axes.unicode_minus\"] = False\n",
    "\n",
    "x_list = list(range(0,10,1))\n",
    "height_list = list(accu_pro.values())\n",
    "rects1 = plt.bar(x=x_list, height=height_list, width=0.5, alpha=0.8, color='red', linewidth=2)\n",
    "# 设置x轴坐标点显示\n",
    "tick_labels = list(accu_pro.keys())\n",
    "tick_pos = x_list\n",
    "plt.xticks(tick_pos, tick_labels)\n",
    "plt.title(\"资产组合的预期违约损失分布\", size=16)\n",
    "plt.xlabel(\"期望损失金额\", size=14)\n",
    "plt.ylabel(\"不违约概率\", size=14)\n",
    "\n",
    "for a,b in zip(x_list,height_list):\n",
    "    plt.text(a, b+0.02, '%.4f' % b, ha='center', va= 'bottom',fontsize=10)\n",
    "    \n",
    "\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[0.0,\n",
       " 0.6769999999999999,\n",
       " 2.031,\n",
       " 2.37,\n",
       " 2.7079999999999997,\n",
       " 2.2575000000000003,\n",
       " 1.692,\n",
       " 1.1864999999999999,\n",
       " 0.45199999999999996,\n",
       " 0.171]"
      ]
     },
     "execution_count": 17,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "E_loss = [i*j for i,j in arr2.items()]# 期望损失\n",
    "E_loss  "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYQAAAEYCAYAAABcGYHrAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvhp/UCwAAIABJREFUeJzt3XmYHFW9//H3JyshLAkyNwJCgoBXwRCFEQiihiXIqogIagARIS6AC1dBFL2g4A9BcQEBg+ayKCAgRHaIQBAQhAk7SryABBLgMmwJELYk398f54ypNN3TnUlXTzL5vJ6nn6muOlXnVM9MffssdUoRgZmZWb/eLoCZmS0bHBDMzAxwQDAzs8wBwczMAAcEMzPLHBDMzAxwQDBbYUhSD/ZZV9LRktYqo0y2bHFAsJaQtLKkgVXWD5C0cuH99ZJOLLy/Q9JJS5DPOpJC0sZLX+p/H/MTknZr1vF6kP8ESWN7sN8xksbn5XcAsyS9awkPsydwNPCW3531PQ4I1lSS7pL0pKTHCq8DgfuBOZJezBfslyS9CLwI3Fc4xGv5VXz/ej720ZIW5GO8KOk1SXdUFGFe/vlqoUxTJb1a2O9FSS9L+meNcxgp6Z2FVZ8C9mvw/CdJ+lVevq6Q33RJ38oB7u+SZku6TdI3C/sOlDREUuX/5YHAdyry6Z/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CJekTQReC0izikWSNIYUg3jaeA9knYsbO4Evp+boc4Gfpj3mQkcCXyMNA/TVOCrLB6MzJrCAcH6qqmkOzwPyu+fAb4EHJrf/xr4KSkQfB84HLiHdKG9DUDSu0nNNONJNYO3R8S4fMH/H+ByUjPSGNLkY3/MLT/vBF6X9Nmc18qki/jfgU9FxOx8/AMAIuKsYsHz7JiTgU+Rpiy4iDRL5j9Is5XOWqpPxqwGBwTrUyQdRmr+eZY0cdj6kg4lTRa2JuniDPAF0uRhAbwH2IQ00d59pIs8wDrAw8DUiDhH0ufy+kMjYlK++PeLiOnk6YklDQT+SuqL2C8qnvUgabik80lNVmvldfsCg4AfR8SVpCDwCeCfpFrBBaRaxTDgOeDtS/1BmVXhgGB9SkScIulN0rf8VUkdx/2BGyLiFi160Mg80rf+10kX5n6kDuGBpPnnu/ojHiG13wPcI2kk8HgernozhYEZORicTZr/5hHgcklfjoi7C+V7QNKVpKeIfSCvvoL0EJ0r8/tBwIbALaRnCEwh1UDeT5pfp+ZQVbOl4VFG1qfk5padSJOH3UHqAP4+cJakocC6wIJID67ZNiJ2Ak4CfhoRO0XE9hFxYj5WP1JQWZgPfxJwJvBL4DJS38ECpcci7k4KEFMj4vyIuAP4PHCq0uMzi49KvBr4eeH9V4FLu95ExEOkgLILsBmpNnE5KSC8CWyW57kxayrPZWR9itKD3OdHnn9e0vrARyPiDEnDgOPKMzb9AAAAoklEQVRINYCvAa/l3UaQvnV3TWA2iNTHcAupueYEUi3iAOB7EXFzHiZ6KGkE0iWkWUx/UTkJWU73UeCmiHhV0gXAf+RXV6BZixTABgGHRMS9kn5Dmkt/N1ItYVPg0xExS+kpc+dGxD+a8ZmZdXFAMGuAJEUv/rNIGhQRb/RW/rZicEAwMzPAfQhmZpY5IJiZGeCAYGZmmQOCmZkBDghmZpb9f1zKWLr4UX8uAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "1.3545\n",
      "0.9374032750102808\n"
     ]
    }
   ],
   "source": [
    "print(np.mean(E_loss))\n",
    "print(np.std(E_loss))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "7"
      ]
     },
     "execution_count": 20,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "round(7.4)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {},
   "outputs": [
    {
     "ename": "SyntaxError",
     "evalue": "invalid syntax (<ipython-input-21-f740c24b68ef>, line 1)",
     "output_type": "error",
     "traceback": [
      "\u001b[1;36m  File \u001b[1;32m\"<ipython-input-21-f740c24b68ef>\"\u001b[1;36m, line \u001b[1;32m1\u001b[0m\n\u001b[1;33m    本文描述的是Credit Risk+模型，该模型是一个信用风险模型，根据银行自身的违约率平均值，结合回收率和风险暴露\u001b[0m\n\u001b[1;37m                    ^\u001b[0m\n\u001b[1;31mSyntaxError\u001b[0m\u001b[1;31m:\u001b[0m invalid syntax\n"
     ]
    }
   ],
   "source": [
    "本文描述的是Credit Risk+模型，该模型是一个信用风险模型，根据银行自身的违约率平均值，结合回收率和风险暴露\n",
    "\n",
    "# 目录\n",
    ">**1.Z计分模型简介**：主要说明Z计分模型是什么，解决什么问题。\n",
    "**2. Z计分模型应用分析的前期准备**：主要说明Z计分模型里的特征含义，以及Z值的用途。\n",
    "**3. Z计分模型程序分析**：主要说明Z计分模型数据来源和最终的结果分析\n",
    "**4. 总结**：总结一下该模型的优势和劣势，再与之前的KMV模型比较看看有何优劣势。\n",
    "#1、简介\n",
    "\n",
    "***模型假设***：(1)每笔贷款在给定期间内**违约率不变**；(2)每个借款人的**违约率非常小**，且**违约数相互独立**。所以违约事件发生的概率分布服从**泊松分布**。\n",
    "\n",
    "***定义***：Credit  Risk+模型仅仅考虑了违约风险，而没有考虑信用等级降级风险，属于信用违约风险度量模型。利用CreditRisk+模型可以**得到贷款组合损失的概率分布。**\n",
    "\n",
    "***流程***：先用贷款组合中最大一笔风险暴露值与风险暴露频段值L相除并四舍五入为整数得到**风险暴露频段总级数m**；然后将每笔贷款的风险暴露数除以L四舍五入为整数将其归类到该整数对应的频段级，即**将所有贷款分类在m个频段级里**；再**计算每个频段级的贷款违约数量的概率分布和违约损失的概率分布**（贷款违约数服从泊松分布，违约损失=违约数量\\*平均风险暴露）；最后**计算贷款组合的违约损失的概率分布**（相同的组合损失金额可能对应多种损失组合，所以要加总概率）\n",
    "\n",
    "#2、计算过程\n",
    "\n",
    "#2.1模型所需特征\n",
    "\n",
    "输入：贷款组合的风险暴露，风险暴露频段值L\n",
    "中间：风险暴露频段级数m，各个频段级的贷款违约数量的概率分布和违约损失的概率分布\n",
    "输出：贷款组合的违约损失的概率分布\n",
    "\n",
    "##2.2计算过程\n",
    "\n",
    "第一步：风险暴露频段分级法\n",
    "\n",
    "我们以 N 笔贷款构成的组合为例，具体介绍频段分级法：\n",
    "\n",
    "第一，先根据所有贷款的风险暴露情况设定风险暴露频段值，记为 L，例如可以取 L = 2 万元作为一个频段值。\n",
    "\n",
    "第二，用 N 笔贷款中最大一笔贷款风险暴露值除以频段值 L，将计算数值按照四舍五入凑成整数，称之为风险暴露的频段总级数，设为 m，于是，就得到 m 个风险暴露频段级，以此为 v1、v2、…、vm，vi 所对应的风险暴露量为 Li。\n",
    "\n",
    "第三，将每笔贷款的风险暴露量除以频段值 L，再按照四舍五入的规则将计算数值凑成整数，然后将该笔贷款归类到该整数值岁对应的频段值，类似地，可将所有贷款归类。\n",
    "\n",
    "第二步：各个频段级的违约概率和损失分布\n",
    "\n",
    "假设处于 vi 频段级的贷款的平均违约数为 λi ，同时设将 N 笔贷款划级归类后处于 vi 频段级的贷款数目为 Ni，显然，N1 + N2 + … + Nm = N于是，可得：\n",
    "\n",
    "![图 2.1](https://upload-images.jianshu.io/upload_images/13541328-96da91e3d302903f.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)\n",
    "\n",
    "其中，L i = L × i 为 vi 频段级对应的风险暴露数，L为频段值，于是，我们可以得到处于 vi 频段级的违约概率分布及其对应的损失分布。\n",
    "\n",
    "第三步：N笔贷款组合的违约概率和损失分布\n",
    "\n",
    "求出各个频段级的贷款违约概率和预期损失后，要加总共 m 个风险暴露频段级的损失，以得到 N 笔贷款组合的损失分布\n",
    "\n",
    "首先要考虑各种预期损失可能的结合来计算概率\n",
    "\n",
    "假设 N 笔贷款中处于 vi 频段级的违约数为 ni，这样得到一个依次对应于 m 个频段级的违约组合（ n1 ，n2 ， …，nm ），于是，根据L i = L× i 可计算出该违约组合对应的风险暴露量为：\n",
    "\n",
    "![图 2.2](https://upload-images.jianshu.io/upload_images/13541328-446cfe25fcb000d0.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)\n",
    "\n",
    "根据贷款违约事件的独立性假设和泊松分布假设，得到对应于违约组合（ n1 ，n2 ， …，nm ）的 N 笔贷款组合的违约概率为：\n",
    "\n",
    "![图 2.3](https://upload-images.jianshu.io/upload_images/13541328-c003e7f6a3f21d6b.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)\n",
    "\n",
    "\n",
    "风险暴露频段级数m：最大一笔风险暴露值/风险暴露频段值L再四舍五入\n",
    "各个频段级的违约数和违约损失的概率分布：\n",
    "\n",
    "![](https://upload-images.jianshu.io/upload_images/15219479-94cee958bcc4a212.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/600)\n",
    "\n",
    "贷款组合的违约数和违约损失的概率分布：\n",
    "\n",
    "![](https://upload-images.jianshu.io/upload_images/15219479-d3c2af79564478cf.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/600)\n",
    "\n",
    "![](https://upload-images.jianshu.io/upload_images/15219479-a496a5357c3ff677.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/600)\n",
    "\n",
    "#3、用到的python库及其方法\n",
    "\n",
    "这里用到了两个库，分别是scipy和numpy。\n",
    "\n",
    "##3.1、scipy\n",
    "\n",
    "scipy库建立在 Numpy 库之上，提供了大量科学算法，主要包括这些主题：\n",
    "*   特殊函数 ([scipy.special](http://docs.scipy.org/doc/scipy/reference/special.html))\n",
    "*   积分 ([scipy.integrate](http://docs.scipy.org/doc/scipy/reference/integrate.html))\n",
    "*   最优化 ([scipy.optimize](http://docs.scipy.org/doc/scipy/reference/optimize.html))\n",
    "*   插值 ([scipy.interpolate](http://docs.scipy.org/doc/scipy/reference/interpolate.html))\n",
    "*   傅立叶变换 ([scipy.fftpack](http://docs.scipy.org/doc/scipy/reference/fftpack.html))\n",
    "*   信号处理 ([scipy.signal](http://docs.scipy.org/doc/scipy/reference/signal.html))\n",
    "*   线性代数 ([scipy.linalg](http://docs.scipy.org/doc/scipy/reference/linalg.html))\n",
    "*   稀疏特征值 ([scipy.sparse](http://docs.scipy.org/doc/scipy/reference/sparse.html))\n",
    "*   **统计 ([scipy.stats](http://docs.scipy.org/doc/scipy/reference/stats.html))**\n",
    "*   多维图像处理 ([scipy.ndimage](http://docs.scipy.org/doc/scipy/reference/ndimage.html))\n",
    "*   文件 IO ([scipy.io](http://docs.scipy.org/doc/scipy/reference/io.html))\n",
    "Credit Risk+模型引入第三方科学计算库模块scipy.stats，使用**poisson(λ)**计算泊松分布的概率质量函数:\n",
    "![](https://upload-images.jianshu.io/upload_images/15219479-1dd9f5b810752a26.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)\n",
    "\n",
    "用法如下：\n",
    "```\n",
    "import scipy.stats as st\n",
    "po = st.poisson(1)\n",
    "[po.pmf(i) for i in range(5)] # pmf: probability mass function，概率质量函数\n",
    "\n",
    "Output:\n",
    "[0.36787944117144233,\n",
    " 0.36787944117144233,\n",
    " 0.18393972058572114,\n",
    " 0.061313240195240391,\n",
    " 0.015328310048810101]\n",
    "```\n",
    "##3.2、numpy\n",
    "使用NumPy可以执行以下操作：\n",
    "（1）数组的算数和逻辑运算。\n",
    "（2）傅立叶变换和用于图形操作的例程。\n",
    "（3）与线性代数有关的操作。 NumPy 拥有线性代数和随机数生成的内置函数。\n",
    "这里使用了数组有关的操作。\n",
    "#4、模型演示\n",
    ">考察一家银行6笔贷款的情况，如下图，假设风险暴露频段值选定为L=5万人民币\n",
    "\n",
    "![](https://upload-images.jianshu.io/upload_images/15219479-5f65e3b0ec23501f.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/300)\n",
    "\n",
    "代码如下：\n",
    "```\n",
    "import numpy as np\n",
    "import scipy.stats as st\n",
    "money = [5,4,8,9,10,3]\n",
    "L = 5\n",
    "labelnum = round(max(money) / L)# 风险暴露总级数\n",
    "label = {}# 频段级及对应的贷款贷款金额\n",
    "for i in money:\n",
    "    for j in range(1, labelnum+1):\n",
    "        if round(i / L) == j:\n",
    "            if j not in label.keys():\n",
    "                label[j] = [i]\n",
    "            else:\n",
    "                label[j].append(i)\n",
    "label\n",
    "Output：{1: [5, 4, 3], 2: [8, 9, 10]}\n",
    "—————————————————————————————————\n",
    "arr = np.zeros((len(label[1])+1,labelnum))# 各个频段级对应的违约数的概率分布\n",
    "# λ=1\n",
    "rv = st.poisson(1)\n",
    "for i in range(arr.shape[0]):\n",
    "    for j in range(arr.shape[1]):\n",
    "        arr[i][j] = round(rv.pmf(i), 4)\n",
    "arr\n",
    "Output：array([[ 0.3679,  0.3679],\n",
    "       [ 0.3679,  0.3679],\n",
    "       [ 0.1839,  0.1839],\n",
    "       [ 0.0613,  0.0613]])\n",
    "—————————————————————————————————\n",
    "pro = np.zeros((arr.shape[0], arr.shape[0]))# 联合违约概率\n",
    "loss = np.zeros((arr.shape[0], arr.shape[0]))# 违约总损失\n",
    "for i in range(pro.shape[0]):\n",
    "    for j in range(pro.shape[1]):\n",
    "        loss[i, j] = i * L + j * 2* L\n",
    "        pro[i, j] = round(arr[i, 0] * arr[j, 1], 4)\n",
    "pro\n",
    "Output：array([[ 0.1354,  0.1354,  0.0677,  0.0226],\n",
    "       [ 0.1354,  0.1354,  0.0677,  0.0226],\n",
    "       [ 0.0677,  0.0677,  0.0338,  0.0113],\n",
    "       [ 0.0226,  0.0226,  0.0113,  0.0038]])\n",
    "loss\n",
    "Output：array([[  0.,  10.,  20.,  30.],\n",
    "       [  5.,  15.,  25.,  35.],\n",
    "       [ 10.,  20.,  30.,  40.],\n",
    "       [ 15.,  25.,  35.,  45.]])\n",
    "—————————————————————————————————\n",
    "arr2 = {}# 整理之后的贷款违约损失的概率分布\n",
    "for i in range(pro.shape[0]):\n",
    "    for j in range(pro.shape[1]):\n",
    "        if loss[i, j] not in arr2.keys():\n",
    "            arr2[loss[i, j]] = pro[i, j]\n",
    "        else:\n",
    "            arr2[loss[i, j]] = round((arr2[loss[i, j]] + pro[i, j]), 4)\n",
    "arr2 = sorted(arr2.items(), key=lambda x: x[0])\n",
    "arr2 = dict(arr2)\n",
    "arr2\n",
    "Output：{0.0: 0.13539999999999999,\n",
    " 5.0: 0.13539999999999999,\n",
    " 10.0: 0.2031,\n",
    " 15.0: 0.158,\n",
    " 20.0: 0.13539999999999999,\n",
    " 25.0: 0.090300000000000005,\n",
    " 30.0: 0.056399999999999999,\n",
    " 35.0: 0.0339,\n",
    " 40.0: 0.011299999999999999,\n",
    " 45.0: 0.0038}\n",
    "—————————————————————————————————\n",
    "accu_pro = {}# 累积概率密度\n",
    "for j in range(len(arr2)):\n",
    "    sum = 0\n",
    "    for i in range(j+1):\n",
    "        sum = sum + list(arr2.values())[i]\n",
    "    accu_pro[list(arr2.keys())[j]] = sum \n",
    "accu_pro = sorted(accu_pro.items(), key=lambda x: x[0])\n",
    "accu_pro = dict(accu_pro)\n",
    "accu_pro\n",
    "Output：{0.0: 0.13539999999999999,\n",
    " 5.0: 0.27079999999999999,\n",
    " 10.0: 0.47389999999999999,\n",
    " 15.0: 0.63190000000000002,\n",
    " 20.0: 0.76729999999999998,\n",
    " 25.0: 0.85760000000000003,\n",
    " 30.0: 0.91400000000000003,\n",
    " 35.0: 0.94790000000000008,\n",
    " 40.0: 0.95920000000000005,\n",
    " 45.0: 0.96300000000000008}\n",
    "—————————————————————————————————\n",
    "E_loss = [i*j for i,j in arr2.items()] # 期望损失\n",
    "E_loss  \n",
    "Output：[0.0,\n",
    " 0.67699999999999994,\n",
    " 2.0310000000000001,\n",
    " 2.3700000000000001,\n",
    " 2.7079999999999997,\n",
    " 2.2575000000000003,\n",
    " 1.6919999999999999,\n",
    " 1.1864999999999999,\n",
    " 0.45199999999999996,\n",
    " 0.17100000000000001]\n",
    "—————————————————————————————————\n",
    "print(np.mean(E_loss))\n",
    "print(np.std(E_loss))\n",
    "Output：1.3545\n",
    "0.93740327501\n",
    "```\n",
    "结果分析：该银行6笔贷款组成的贷款组合，未来一年期望的损失金额为1.35万人民币，大致可看出未来有95%的把握损失不会超过40万人民币。\n",
    "\n",
    "#5、模型优缺点\n",
    "\n",
    "**优点：**\n",
    "（1）要求的估计量和输入数据较少，仅需要债务工具的违约和风险暴露的数据，模型应用比较简单\n",
    "（2）不需要对违约原因做任何假设\n",
    "（3）将违约率视为连续随机变量，并将违约率的波动率纳入模型体现违约率本身的不确定性这一特征。通过使用违约波动率参数，模型得到简化，而且不用考虑违约相关性特征\n",
    "\n",
    "**缺点：**\n",
    "（1）忽略了信用等级变化，因而贷款信用风险在计算期间内固定不变，与实际情况不符合\n",
    "（2）分组时，对每笔贷款暴露近似到组，从而将高估投资组合的方差\n",
    "（3）忽略了市场风险"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.5"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
